﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using CDMS.BLL;
using CDMS.Report;
using DevExpress.XtraReports.UI;

namespace CDMS.Report
{
    public partial class frmPreviewReport : XtraForm
    {
        EnumReport enumReport;
        public frmPreviewReport(EnumReport enumReport)
        {
            InitializeComponent();
            this.enumReport = enumReport;
        }

        private void frmPreviewReport_Load(object sender, EventArgs e)
        {
            XtraReport rpt = new XtraReport();
            switch (enumReport)
            {
                case EnumReport.DSKhachHang:
                    rpt = new XtraReportDemo2();
                    break;
                case EnumReport.DSHopDong:
                    rpt = new XtraReportContractList();
                    break;
                default:
                    break;
            }

            documentViewer1.PrintingSystem = rpt.PrintingSystem;
            rpt.CreateDocument();
        }
    }
}